{extend name="public/base"/}
{block name="content"}

<section class="content">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header" style="zoom:1;overflow: hidden;">
                    <h3 class="box-title" style="float:left;margin-right:10px;">
                        <a href="{:U('Links/index')}" class="btn btn-primary">链接列表</a>
                    </h3>

                    <h3 class="box-title" style="float:left;margin-right:10px;">
                        <a href="{:U('Links/add')}" class="btn btn-primary">添加链接</a>
                    </h3>

                    <h3 class="box-title" style="float:left;margin-right:10px;">
                        <a href="{:U('Links/lid_index')}" class="btn btn-primary">类别列表</a>
                    </h3>

                    <h3 class="box-title" style="float:left;margin-right:10px;">
                        <a href="{:U('Links/lid_add')}" class="btn btn-primary">添加类别</a>
                    </h3>

                    <h3 class="box-title">
                        <form action="{:U('Links/index')}" name="lid" class="seaform" method="POST">
                            <select name="lid" id="select_id" class="form-control">
                                <option value="">筛选类别</option>
                                <option value="0">全部</option>
                                {volist name="link_type" id="data"}
                                <option value="{$data.id}">{$data.name}</option>
                                {/volist}

                            </select>
                        </form>

                        <script>
                            $(document).ready(function () {
                                $("#select_id").change(function () {
                                    $('.seaform').submit();
                                });
                            });
                        </script>

                    </h3>
                </div>
                <style type="text/css">
                    .aimg {
                        width: 50px;
                        height: 50px;
                        -webkit-border-radius: 100px;
                        -moz-border-radius: 100px;;
                        border-radius: 100px;
                    }

                    #lista td {
                        line-height: 60px;
                    }
                </style>
                <!-- /.box-header -->
                <div class="box-body">
                    <table class="table table-bordered table-hover">
                        <!-- 列表头部 -->
                        <thead>
                        <tr>
                            <th>排序</th>
                            <th>网站名称</th>
                            <th>图片LOGO</th>
                            <th>链接</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <!-- 列表头部 -->

                        <!-- 循环列表 -->

                        {volist name="get_links" id="data"}
                        <tbody style="border:none">
                        <tr id="lista">
                            <td><input name="listorder" class="listorder" type="text" data-orderid="{$data.id}"
                                       value="{$data.listorder}" style="width:30px;"/></td>
                            <td>{$data.name}</td>
                            <td><img src="__UPLOADS__{$data.logo}" class="aimg"></td>
                            <td><a href="{$data.links}">{$data.links}</a></td>
                            <td>
                                <a href="{:U('Links/edit',array('id'=>$data['id']))}"
                                   class="btn btn-primary btn-xs">修改</a>

                                <a href="{:U('Links/del',array('id'=>$data['id']))}"
                                   class="btn btn-success btn-xs">删除</a>

                            </td>
                        </tr>
                        </tbody>
                        {/volist}
                        <!-- 循环列表 END -->
                    </table>
                    {$page}
                </div>

                <script>
                    <!--
                    排序开始-->
                    $(":text").change(function () {
                        $.ajax({
                            type: "post",
                            url: "{:U('Links/listorder')}",
                            dataType: "json",
                            data: {
                                listorder: $(this).val(),
                                listorder_id: $(this).data("orderid"),
                            },
                            success:　
			  function (data) {
                  alert(data);
              }

                        ,

                    });

                    })
                    ;
                    <!-- 排序结束-->
                </script>
            </div>
        </div>
    </div>


</section>
{/block}